package com.wooshow.base.local;

import org.apache.commons.dbcp.BasicDataSource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.wooshow.base.Constant;
import com.wooshow.base.crypto.AES;


public class LocalBasicDataSource extends BasicDataSource {

	public static Log log = LogFactory.getLog(LocalBasicDataSource.class);
	
    public synchronized void setPassword(String password) {
	    try {
	        super.setPassword(AES.decrypt(password, Constant.AES_KEY));
        } catch (Exception e) {
	        log.error("fail to decrypt the password...");
        }
    }


}
